<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>时间计算</title>
   </head>
   <body>
      <script>
         let seconds = +prompt('请输入秒数')
         function time(seconds){
            let h = Math.floor(seconds / 3600)
            let m = Math.floor(seconds % 3600 / 60)
            let s = Math.floor(seconds % 60)
            h = h<10 ? '0' + h : h
            m = m<10 ? '0' + m : m
            s = s<10 ? '0' + s : s
            return `转换后时间:${h}小时${m}分钟${s}秒`
         }
         // alert(time(seconds))
         document.write(time(seconds))
      </script>
   </body>
</html>